﻿loading2 = function () {
    var ajaxbg = top.$("#loading_background,#loading_manage");
    top.$("#loading_manage").html("正在加载，请稍候…");
    top.$("#loading_manage").css("left", (top.$('body').width() - top.$("#loading_manage").width()) / 2 - 54);
    top.$("#loading_manage").css("top", (top.$('body').height() - top.$("#loading_manage").height()) / 2);
    ajaxbg.show();
    var load = setInterval(function () {
        if (document.readyState == "complete") {
            ajaxbg.hide();
            clearInterval(load);
            return;
        }
    }, 100);
}
ajaxshow = function () {
    var ajaxbg = top.$("#loading_background,#loading_manage");
    top.$("#loading_manage").html("正在加载，请稍候…");
    top.$("#loading_manage").css("left", (top.$('body').width() - top.$("#loading_manage").width()) / 2 - 54);
    top.$("#loading_manage").css("top", (top.$('window').height() - top.$("#loading_manage").height()) / 2);
    ajaxbg.show();
}
ajaxend = function () {
    var ajaxbg = top.$("#loading_background,#loading_manage");
    top.$("#loading_manage").html("正在加载，请稍候…");
    top.$("#loading_manage").css("left", (top.$('body').width() - top.$("#loading_manage").width()) / 2 - 54);
    top.$("#loading_manage").css("top", (top.$('window').height() - top.$("#loading_manage").height()) / 2);
    ajaxbg.hide();
}
Loading = function (bool, text) {
    var ajaxbg = top.$("#loading_background,#loading_manage");
    top.$("#loading_manage").html("正在加载，请稍候…");
    top.$("#loading_manage").css("left", (top.$('body').width() - top.$("#loading_manage").width()) / 2 - 54);
    top.$("#loading_manage").css("top", (top.$('body').height() - top.$("#loading_manage").height()) / 2);
    if (bool) {
        ajaxbg.show();
    } else {
        if (top.$("#loading_manage").attr('istableloading') == undefined) {
            ajaxbg.hide();
            top.$(".ajax-loader").remove();
        }
    }
}
function completeLoading() {
    if (document.readyState == "complete") {
        loading(false);
    }
}